<?php if(!$this->key):?>
<div style="padding-bottom:5px;"><?php echo $this->translator('search_not_key');?></div>
<?php else:?>
<div style="padding-bottom:5px;"><label style='color:#FF9900; font-weight:bold;'><?php echo $this->numEnterprise;?></label> <?php echo $this->translator('search_guide');?> "<label style='color:#FF9900; font-weight:bold;'><?php echo $this->exp['keyword'];?></label>"</div>
<?php
    $skin_url = $this->APP_STATIC_SERVER . '/skins/'. $this->APP_TEMPLATE . '/'. $this->APP_SKIN;
?>
<?php $i=0; foreach ($this->enterprises as $enterprise):?>
<?php

    /**
    * Param url detail
    **/
    $arrRouteDetail = array(
        'enterprise_id' => $enterprise->id,
        'enterprise_name' => Tomato_Utility_String::removeSign($enterprise->company_name_en, '-', true),
    );

    $enterprise_name = $enterprise->company_name_vn;

    $arrRouteView = array(
        'enterprise_id' => $enterprise->id,
        'enterprise_name' => Tomato_Utility_String::removeSign($enterprise->company_name_en, '-', true),
        'blog_id' => $enterprise->blog_id,
        'slug' => $enterprise->slug,
    );
?>

<div class="subrow">
    <div class="subcolumns_oldgecko" style="padding-bottom:5px;">
        <div style="float:left; width:100%" class="subcolumns">
            <a href="<?php echo $this->url($arrRouteView, 'b2b_blog_view'); ?>"><span class="title"><?php echo $enterprise->title;?></span></a> (<?php echo date('d-m-Y', strtotime($enterprise->date));?>)<br/>
            <a href="<?php echo $this->url($arrRouteDetail,'bizprofile_enterprise_index');?>"><?php echo $enterprise_name;?></a> (<?php echo $enterprise->company_name_en;?>)
            <div style="text-align:justify">
                <?php echo isset($enterprise->content)?Tomato_Helper_Helper::substring($enterprise->content, 450):null;?>
            </div>
        </div>
    </div>
</div>
<?php endforeach;?>

<?php if($this->numEnterprise > 0 ):?>
<div class="blog_paginator"><?php echo $this->paginator()->slide($this->paginator, $this->paginatorOptions);?></div>
<?php endif;?>
<script type="text/javascript">
$(document).ready(function() {
    $('.blog_paginator span a').click(function(evt){
        evt.preventDefault();
        href = $(this).attr('href');
        me = $(this);
        blogLoad1(me, href);
    });
});

function blogLoad1(me, url){
    var keyword   = '<?php echo isset($this->exp['keyword'])?$this->exp['keyword']:null;?>';
    var from_date = '<?php echo isset($this->exp['v_from_date'])?$this->exp['v_from_date']:null;?>';
    var to_date   = '<?php echo isset($this->exp['v_to_date'])?$this->exp['v_to_date']:null;?>';
    var type      = '<?php echo isset($this->exp['type'])?$this->exp['type']:'basic';?>';

    http = 'http://'+'<?php echo $_SERVER['HTTP_HOST'];?>';
    route = http+url;
    $(me).html('').addClass('t_a_ui_helper_loading');
    jQuery.ajaxq('blog', {
        type: 'POST',
        url: route,
        data: { keyword:keyword, from_date:from_date, to_date:to_date, type:type },
        success: function(html) {
            $(me).html('').addClass('t_a_ui_helper_loading');
            $('#blogOutput').html(html);
        }
    });
}
</script>
<?php endif;?>